exports.showIndex= async (req,res,next)=>{
    try{
        console.log(req.session.user);
        await res.render('../views/index.html',{
            sessionUser: req.session.user,
        });
    }catch (err){
        next(err)
    }
}

exports.showRegister = async (req,res,next)=>{
    try{
        await res.render('../views/User.html',{
            sessionUser: req.session.user,
            isRegister: true
        });
    }catch (err){
        next(err);
    }
}

exports.showLogin = async (req,res,next)=>{
    try{
        await res.render('../views/User.html',{
            sessionUser: req.session.user,
            isRegister: false
        });
    }catch (err){
        next(err);
    }
}

exports.showCreateArticle = async (req,res,next)=>{
    try{
        await res.render('../views/CreateArticle.html',{
            sessionUser: req.session.user,
        });
    }catch (err){
        next(err);
    }
}

exports.showSetArticle = async (req,res,next)=>{
    try{
        await res.render('../views/Setting.html',{
            sessionUser: req.session.user,
        });
    }catch (err){
        next(err);
    }
}

exports.showTags = async (req,res,next)=>{
    try{
        res.render('../views/tags.html')
    }catch (err){
        next(err);
    }
}